package controllers

import (
	"github.com/revel/revel"
	"wuhuaguo.com/whg01/app/models"
	"wuhuaguo.com/whg01/app/models/carts"
)

func init() {
	revel.OnAppStart(models.InitDB)
	revel.OnAppStart(carts.InitCartMap)
	revel.InterceptMethod((*GorpController).Begin, revel.BEFORE)
	revel.InterceptMethod(WxApp.AddUser, revel.BEFORE)
	//检查用户信息
	revel.InterceptMethod(Application.CheckUser, revel.BEFORE)

	revel.InterceptMethod((*GorpController).Commit, revel.AFTER)
	revel.InterceptMethod((*GorpController).Rollback, revel.FINALLY)

}
